﻿using System;
using System.Collections.Generic;
using System.Text;
using DailyDiet.Services;
using DailyDiet.Services.Constant;
using DailyDiet.Services.Impl;
using Moq;
using NUnit.Framework;

namespace DailyDietTest.Helper
{
    public class RecommendServiceImplHealper {
        private static IRecommendService _recommendService;

        public static IRecommendService GetInitializedRecommendServiceImpl() {
            if (_recommendService != null) {
                return _recommendService;
            }

            var preferenceMock = new Mock<IPreferenceStorage>();

            preferenceMock.Setup(p => p.Get(TasteSetConstant.SpicyIndexKey, TasteSetConstant.DefaultIndex)).Returns(50);
            preferenceMock.Setup(p => p.Get(TasteSetConstant.SweetIndexKey, TasteSetConstant.DefaultIndex)).Returns(50);
            preferenceMock.Setup(p => p.Get(TasteSetConstant.TasteIndexKey, TasteSetConstant.DefaultIndex)).Returns(50);
            preferenceMock.Setup(p => p.Get(TasteSetConstant.HealthIndexKey, TasteSetConstant.DefaultIndex)).Returns(50);

            _recommendService = new RecommendServiceImpl(preferenceMock.Object);

            return _recommendService;
        }
    }
}
